home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 44 / Amiga Format CD44 (1999-08-26)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-10].iso / -in_the_mag- / basics / prime_tests / primes3000.bb2.text < prev    next >
Text File  |  1999-07-24  |  383b  |  26 lines

  1.  
  2. ; This program finds the prime-numbers from 2 To 3000
  3. ; N.B, Use TimeCMD as Blitz 2 lacks the TIMER function
  4.  
  5.  DEFTYPE.w
  6.  
  7.  Print "prime numbers from 2 to 3000:"
  8.  
  9.  
  10.  BeginTime=TIMER
  11.  
  12.   Print BeginTime
  13.  For a = 2 To 3000
  14.    For b = 3 To a-1
  15.      If (a MOD b) = 0 Then Goto NotPrim
  16.    Next b
  17.    ; Print a
  18. NotPrim
  19.  Next a
  20.  
  21.  Print "time needed:"+Str$(TIMER-BeginTime)+" s."
  22.  
  23.  MouseWait
  24.  
  25.  
  26.